USE [TakeAway]
GO

/****** Object:  Table [dbo].[ItemPedido]    Script Date: 09/13/2010 02:26:26 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[ItemPedido](
	[Id] [bigint] NOT NULL,
	[IdItem] [bigint] IDENTITY(1,1) NOT NULL,
	[Familia] [varchar](100) NULL,
	[ReferenciaProduto] [varchar](50) NOT NULL,
	[NomeProduto] [varchar](100) NOT NULL,
	[Quantidade] [real] NOT NULL,
	[PrecoTabela] [money] NULL,
	[Valor] [money] NOT NULL,
	[ValorTotal] [money] NOT NULL,
	[PercentagemIva] [numeric](5, 2) NOT NULL,
	[Stock] [bit] NOT NULL,
	[Observacoes] [varchar](1000) NULL,
 CONSTRAINT [PK_ItemPedido] PRIMARY KEY CLUSTERED 
(
	[IdItem] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

SET ANSI_PADDING OFF
GO

ALTER TABLE [dbo].[ItemPedido]  WITH CHECK ADD  CONSTRAINT [FK_ItemPedido_Pedido] FOREIGN KEY([Id])
REFERENCES [dbo].[Pedido] ([Id])
GO

ALTER TABLE [dbo].[ItemPedido] CHECK CONSTRAINT [FK_ItemPedido_Pedido]
GO


